#include <stdio.h>

int main(void)
{
	int row,center,column,blank,tempRow=1,tempColumn=1,blankTemp;
	printf("input a number:");
	scanf("%d",&row);
	row = (row%2) ? (row + 1) : row;
	column = 2 * row - 1;
	getchar();
	center = column / 2 + 1;
	while(tempRow <= row)
	{
		blank = ((tempRow * 2) - 2) / 2;
		tempColumn = 1;
		while(tempColumn <= column)
		{
			blankTemp = tempColumn - center;
			blankTemp = blankTemp > 0 ? blankTemp : (-1 * blankTemp);
			//printf("blank=%d,blankTemp=%d\n",blank,blankTemp);
			if(blankTemp <= blank)
			{
				printf("*");	
			}
			else
			{
				printf(" ");		
			}
			if(tempColumn == (center + blank))
			{
				break;
			}	
			tempColumn++;
		}
		printf("\n");	
		//if(
		tempRow++;	
	}
	return 0;
}
